//
//  HttpRequest.m
//  SmartCity
//
//  Created by DEV on 15/3/9.
//  Copyright (c) 2015年 com.SmartCity. All rights reserved.
//
/*
 
 通用接口设计，block前后块内包含HUD代码，dicheader,errormsg,判断success代码，参数用...直到nil输入截止
 
 */


#import "HttpRequest.h"
//#import "BankCardModel.h"


@implementation HttpRequest

//+ (NSString*)getInterfaceURL:(NSString*)strURLPart
//{
//    //http://apiserver:8080/paymentGuide/sendSMSCodeGuide.action
////    return [NSString stringWithFormat:@"%@%@",URL_HTTPSERVERV11,strURLPart];
//    
//     return [NSString stringWithFormat:@"%@%@",[MxGlobal sharedMxGlobal].strIURL,strURLPart];
//}
//
//
////查询市民卡公交，中城账户余额
//+ (void)queryCardBalanceByCtCardNo:(NSString *)citizenCardNum UserId:(NSString *)userId block:(void(^)(NSString *citizenCardStatus, NSString *busBalance, NSString *cardBalance))success fail:(void(^)(NSString *errorMsg))fail
//{
//    [MxGlobal showWaiting];
//    
//    NSDictionary *dicMsg = [NSDictionary dictionaryWithObjectsAndKeys:citizenCardNum,@"citizenCardNum", nil];
//
//    NSDictionary *dicPara = [ProtocolParserPack packwithDicMsg:dicMsg];
//    
//    NSString *strUrl = [HttpRequest getInterfaceURL:@"citizenCards/queryCardBalance.action"];
//    
//    [AFNetWorkingWrapper PostAndAcceptJson:dicPara URL:strUrl Success:^(AFHTTPRequestOperation *operation, id jsonObject) {
//        
//
//        [MxGlobal dismissWaiting];
//
//        NSDictionary *dicHeader = [jsonObject objectForKey:@"head"];
//        if(!dicHeader){
//            fail(@"服务器异常");
//            return ;
//        }
//        NSString *errorMsg = [dicHeader objectForKey:@"errorMsg"];
//        
//        if ([ProtocolParserPack isSuccessful:dicHeader]) {
//            NSDictionary *dicMsg = [jsonObject objectForKey:@"message"];
//            
//            NSString *activityStatus = [dicMsg objectForKey:@"citizenCardStatus"];
//            NSString *busBalance = [dicMsg objectForKey:@"busBalance"];
//            NSString *cardBalance = [dicMsg objectForKey:@"cardBalance"];
//        
//            success(activityStatus,busBalance,cardBalance);
//            
//        }else fail(errorMsg);
//         
//        
//    } Failure:^(AFHTTPRequestOperation *operation, NSError *error) {
//        
//        [MxGlobal dismissWaiting];
//        
//        fail(@"服务器连接异常");
//    }];
//    
//}
//
////查询市民卡消费明细
//+ (void)getCardUsedInfoByCtCardNo:(NSString *)citizenCardNum Type:(NSString *)type PageStartIndex:(int)pageStartIndex CurrentTimes:(NSString *)currentTimes block:(void(^)(NSArray *cardTradeRecordList))success fail:(void(^)(NSString *errorMsg))fail
//{
//
//    NSDictionary *dicMsg = [NSDictionary dictionaryWithObjectsAndKeys:citizenCardNum,@"citizenCardNum",type,@"type",[NSNumber numberWithInt:pageStartIndex],@"pageStartIndex",currentTimes,@"currentTimes", nil];
//    
//    NSDictionary *dicPara = [ProtocolParserPack packwithDicMsg:dicMsg];
//    
//    NSString *strUrl = [HttpRequest getInterfaceURL:@"citizenCards/getCardUsedInfo.action"];
//    
//    [AFNetWorkingWrapper PostAndAcceptJson:dicPara URL:strUrl Success:^(AFHTTPRequestOperation *operation, id jsonObject) {
//        
//        NSDictionary *dicHeader = [jsonObject objectForKey:@"head"];
//        NSString *errorMsg = [dicHeader objectForKey:@"errorMsg"];
//        if([ProtocolParserPack isSuccessful:dicHeader]){
//            
//            NSDictionary *dicMsg = [jsonObject objectForKey:@"message"];
//            NSArray *arrayBranchLish = [dicMsg objectForKey:@"cardTradeRecordList"];
//            
//            success(arrayBranchLish);
//            
//            
//        }else fail(errorMsg);
//        
//    } Failure:^(AFHTTPRequestOperation *operation, NSError *error) {
//    
//        [MxGlobal showErrorwithStatus:@"服务器连接异常" finish:nil];
//        
//    }];
//}
//
////扫描二维码解析市民卡
//+ (void)analysisCitizenCardByQRCode:(NSString *)QRCode block:(void(^)(NSString *cardSerialNum, NSString *citizenCardNum, NSString *userName))success fail:(void(^)(NSString *errorMsg))fail
//{
//    [MxGlobal showWaiting];
//    
//    NSDictionary *dicMsg = [NSDictionary dictionaryWithObjectsAndKeys:QRCode,@"code", nil];
//    
//    NSDictionary *dicPara = [ProtocolParserPack packwithDicMsg:dicMsg];
//    
//    NSString *strUrl = [HttpRequest getInterfaceURL:@"scan/analysisCitizenCard.action"];
//    
//    [AFNetWorkingWrapper PostAndAcceptJson:dicPara URL:strUrl Success:^(AFHTTPRequestOperation *operation, id jsonObject) {
//        
//        [MxGlobal dismissWaiting];
//        
//        NSDictionary *dicHeader = [jsonObject objectForKey:@"head"];
//        NSString *errorMsg = [dicHeader objectForKey:@"errorMsg"];
//        if([ProtocolParserPack isSuccessful:dicHeader]){
//            
//            NSDictionary *dicMsg = [jsonObject objectForKey:@"message"];
//            NSString *cardSerialNum = [dicMsg objectForKey:@"cardSerialNum"];
//            NSString *citizenCardNum = [dicMsg objectForKey:@"citizenCardNum"];
//            NSString *userName = [dicMsg objectForKey:@"userName"];
//            success(cardSerialNum,citizenCardNum,userName);
//            
//        }else fail(errorMsg);
//
//        
//    } Failure:^(AFHTTPRequestOperation *operation, NSError *error) {
//        
//        [MxGlobal dismissWaiting];
//        
//        fail(@"服务器连接异常");
//        
//        
//    }];
//}
//
////发送动态验证码到手机(包括用户注册、修改密码、联机账户激活)
//+ (void)sendSmsCodeByMobileNum:(NSString *)mobile Type:(NSString *)type TemplateID:(NSString *)templateId block:(void(^)())success fail:(void(^)(NSString *errorMsg))fail
//{
//    [MxGlobal showWaiting];
//    NSDictionary *dicMsg = [NSDictionary dictionaryWithObjectsAndKeys:mobile,@"mobile",type,@"type",templateId,@"templateId", nil];
//    
//    NSDictionary *dicPara = [ProtocolParserPack packwithDicMsg:dicMsg];
//    
//    NSString *strUrl = [HttpRequest getInterfaceURL:@"sendSms/sendSmsCode.action"];
//    
//    [AFNetWorkingWrapper PostAndAcceptJson:dicPara URL:strUrl Success:^(AFHTTPRequestOperation *operation, id jsonObject) {
//        [MxGlobal dismissWaiting];
//        NSDictionary *dicHeader = [jsonObject objectForKey:@"head"];
//        NSString *errorMsg = [dicHeader objectForKey:@"errorMsg"];
//        if([ProtocolParserPack isSuccessful:dicHeader]){
//            
//            success();
//            
//        }else fail(errorMsg);
//        
//    } Failure:^(AFHTTPRequestOperation *operation, NSError *error) {
//
//        [MxGlobal dismissWaiting];
//        fail(@"服务器连接异常");
//        
//    }];
//}
//
////验证短信动态验证码
//+ (void)checkSmsCodeBySMSCode:(NSString *)checkCode Mobile:(NSString *)mobile block:(void(^)())success fail:(void(^)(NSString *errorMsg))fail
//{
//    [MxGlobal showWaiting];
//    NSDictionary *dicMsg = [NSDictionary dictionaryWithObjectsAndKeys:checkCode,@"checkCode",mobile,@"mobile", nil];
//    NSDictionary *dicPara = [ProtocolParserPack packwithDicMsg:dicMsg];
//    
//    NSString *strUrl = [HttpRequest getInterfaceURL:@"sendSms/checkSmsCode.action"];
//    
//    [AFNetWorkingWrapper PostAndAcceptJson:dicPara URL:strUrl Success:^(AFHTTPRequestOperation *operation, id jsonObject) {
//        [MxGlobal dismissWaiting];
//        
//        NSDictionary *dicHeader = [jsonObject objectForKey:@"head"];
//        NSString *errorMsg = [dicHeader objectForKey:@"errorMsg"];
//        
//        if([ProtocolParserPack isSuccessful:dicHeader]){
//        
//            success();
//        }else fail(errorMsg);
//        
//    } Failure:^(AFHTTPRequestOperation *operation, NSError *error) {
//        [MxGlobal dismissWaiting];
//        fail(@"服务器连接异常");
//    }];
//}
//
////联机账户激活（查询市民卡卡号，真实姓名）
//+ (void)checkRealNameInfoByCtCardNo:(NSString *)citizenCardNum RealName:(NSString *)realName UserId:(NSString *)userId block:(void(^)())success fail:(void(^)(NSString *errorMsg))fail
//{
//    [MxGlobal showWaiting];
//    NSDictionary *dicMsg = [NSDictionary dictionaryWithObjectsAndKeys:citizenCardNum,@"citizenCardNum",realName,@"realName", nil];
//    NSDictionary *dicPara = [ProtocolParserPack packwithDicMsg:dicMsg];
//    
//    NSString *strUrl = [HttpRequest getInterfaceURL:@"onlineAccount/checkRealNameInfo.action"];
//    
//    [AFNetWorkingWrapper PostAndAcceptJson:dicPara URL:strUrl Success:^(AFHTTPRequestOperation *operation, id jsonObject) {
//        [MxGlobal dismissWaiting];
//        NSDictionary *dicHeader = [jsonObject objectForKey:@"head"];
//        NSString *errorMsg = [dicHeader objectForKey:@"errorMsg"];
//        if ([ProtocolParserPack isSuccessful:dicHeader]){
//            success();
//        }else fail(errorMsg);
//        
//    } Failure:^(AFHTTPRequestOperation *operation, NSError *error) {
//        [MxGlobal dismissWaiting];
//        fail(@"服务器连接异常");
//    }];
//}
//
////联机账户激活(初始密码)
//+ (void)onlineAccountActivateByCtCardNo:(NSString *)citizenCardNum UserId:(NSString *)userId HardwareNum:(NSString *)hardwareNum Sign:(NSString *)sign block:(void(^)())success fail:(void(^)(NSString *errorMsg))fail
//{
//    [MxGlobal showWaiting];
//    NSDictionary *dicMsg = [NSDictionary dictionaryWithObjectsAndKeys:citizenCardNum,@"citizenCardNum",hardwareNum,@"hardwareNum",sign,@"sign",nil];
//    NSDictionary *dicPara = [ProtocolParserPack packwithDicMsg:dicMsg];
//    
//    NSString *strUrl = [HttpRequest getInterfaceURL:@"onlineAccount/onlineAccountActivation.action"];
//    
//    [AFNetWorkingWrapper PostAndAcceptJson:dicPara URL:strUrl Success:^(AFHTTPRequestOperation *operation, id jsonObject) {
//        [MxGlobal dismissWaiting];
//        NSDictionary *dicHeader = [jsonObject objectForKey:@"head"];
//        NSString *errorMsg = [dicHeader objectForKey:@"errorMsg"];
//        
//        if ([ProtocolParserPack isSuccessful:dicHeader]) {
//            success();
//        }else fail(errorMsg);
//  
//    } Failure:^(AFHTTPRequestOperation *operation, NSError *error) {
//        [MxGlobal dismissWaiting];
//        fail(@"服务器连接异常");
//    }];
//    
//}
//
////联机账户改密
//+ (void)modifyOnlineAccountPSDByCtCardNo:(NSString *)citizenCardNum UserId:(NSString *)userId HardwareNum:(NSString *)hardwareNum Sign:(NSString *)sign block:(void(^)())success fail:(void(^)(NSString *errorMsg))fail
//{
//    [MxGlobal showWaiting];
//    NSDictionary *dicMsg = [NSDictionary dictionaryWithObjectsAndKeys:citizenCardNum,@"citizenCardNum",hardwareNum,@"hardwareNum",sign,@"sign",nil];
//    NSDictionary *dicPara = [ProtocolParserPack packwithDicMsg:dicMsg];
//    
//    NSString *strUrl = [HttpRequest getInterfaceURL:@"onlineAccount/modifyonlineAccountpsd.action"];
//    
//    [AFNetWorkingWrapper PostAndAcceptJson:dicPara URL:strUrl Success:^(AFHTTPRequestOperation *operation, id jsonObject) {
//        [MxGlobal dismissWaiting];
//        NSDictionary *dicHeader = [jsonObject objectForKey:@"head"];
//        NSString *errorMsg = [dicHeader objectForKey:@"errorMsg"];
//        
//        if([ProtocolParserPack isSuccessful:dicHeader]){
//            
//            success();
//        }else fail(errorMsg);
//
//    } Failure:^(AFHTTPRequestOperation *operation, NSError *error) {
//         [MxGlobal dismissWaiting];
//         fail(@"服务器连接异常");
//    }];
//    
//    
//}
//
////联机账户重置密码（验证卡号和身份证号)
//+ (void)checkCardNoAndIdCardByCtCardNo:(NSString *)citizenCardNum UserId:(NSString *)userId IDCardNum:(NSString *)idCardNum HardNum:(NSString *)hardNum block:(void(^)())success fail:(void(^)(NSString *errorMsg))fail
//{
//     [MxGlobal showWaiting];
//     NSDictionary *dicMsg = [NSDictionary dictionaryWithObjectsAndKeys:citizenCardNum,@"citizenCardNum",idCardNum,@"idCardNum",hardNum,@"hardwareNum", nil];
//     NSDictionary *dicPara = [ProtocolParserPack packwithDicMsg:dicMsg];
//    
//     NSString *strUrl = [HttpRequest getInterfaceURL:@"onlineAccount/checkCardNoAndIdCard.action"];
//    
//    [AFNetWorkingWrapper PostAndAcceptJson:dicPara URL:strUrl Success:^(AFHTTPRequestOperation *operation, id jsonObject) {
//        //
//        [MxGlobal dismissWaiting];
//        
//        NSDictionary *dicHeader = [jsonObject objectForKey:@"head"];
//        NSString *errorMsg = [dicHeader objectForKey:@"errorMsg"];
//        
//        if([ProtocolParserPack isSuccessful:dicHeader]){
//            success();
//        }else fail(errorMsg);
//
//        
//    } Failure:^(AFHTTPRequestOperation *operation, NSError *error) {
//        //
//        [MxGlobal dismissWaiting];
//        
//        fail(@"服务器连接异常");
//    }];
//}
//
////联机账户重置密码（输入新密码)
//+ (void)resetPassWordByCtCardNo:(NSString *)citizenCardNum IDCardNum:(NSString *)idCardNum HardwareNum:(NSString *)hardwareNum UserId:(NSString *)userId Sign:(NSString *)sign block:(void(^)())success fail:(void(^)(NSString *errorMsg))fail
//{
//    [MxGlobal showWaiting];
//    NSDictionary *dicMsg = [NSDictionary dictionaryWithObjectsAndKeys:citizenCardNum,@"citizenCardNum",idCardNum,@"idCardNum",hardwareNum,@"hardwareNum",sign,@"sign", nil];
//    NSDictionary *dicPara = [ProtocolParserPack packwithDicMsg:dicMsg];
//    
//    NSString *strUrl = [HttpRequest getInterfaceURL:@"onlineAccount/resetPassword.action"];
//    
//    [AFNetWorkingWrapper PostAndAcceptJson:dicPara URL:strUrl Success:^(AFHTTPRequestOperation *operation, id jsonObject) {
//        
//        [MxGlobal dismissWaiting];
//        
//        NSDictionary *dicHeader = [jsonObject objectForKey:@"head"];
//        NSString *errorMsg = [dicHeader objectForKey:@"errorMsg"];
//        
//        if([ProtocolParserPack isSuccessful:dicHeader]){
//            success();
//        }else fail(errorMsg);
//
//        
//        
//    } Failure:^(AFHTTPRequestOperation *operation, NSError *error) {
//        
//        [MxGlobal dismissWaiting];
//        
//        fail(@"服务器连接异常");
//    }];
//    
//    
//}
//
//// 发送短信重置联机账户密码
//
//+ (void)sendCodeToUpdateCTZCardPwdByCtCardNo:(NSString *)citizenCardNum UserId:(NSString *)userId MobileNum:(NSString *)mobileNum block:(void(^)())success fail:(void(^)(NSString *errorMsg))fail
//{
//    [MxGlobal showWaiting];
//    NSDictionary *dicMsg = [NSDictionary dictionaryWithObjectsAndKeys:citizenCardNum,@"citizenCardNum",mobileNum,@"mobileNo", nil];
//    NSDictionary *dicPara = [ProtocolParserPack packwithDicMsg:dicMsg];
//    
//    NSString *strUrl = [HttpRequest getInterfaceURL:@"onlineAccount/sendCodeToUpdateCTZCardPwd.action"];
////     NSString *strUrl =  @"http://172.18.10.188:8080/ZCCardServer/onlineAccount/sendCodeToUpdateCTZCardPwd.action";
//    [AFNetWorkingWrapper PostAndAcceptJson:dicPara URL:strUrl Success:^(AFHTTPRequestOperation *operation, id jsonObject) {
//        
//        [MxGlobal dismissWaiting];
//        NSDictionary *dicHeader = [jsonObject objectForKey:@"head"];
//        NSString *errorMsg = [dicHeader objectForKey:@"errorMsg"];
//        
//        if ([ProtocolParserPack isSuccessful:dicHeader]) {
//            success();
//        }else fail(errorMsg);
//        
//        
//    } Failure:^(AFHTTPRequestOperation *operation, NSError *error) {
//         [MxGlobal dismissWaiting];
//        fail(@"服务器连接异常");
//    }];
//}
//
//
//
//
////消费账户话费充值(输入支付密码) 
//
//+ (void)cardConsumeCommitByCtCardNo:(NSString *)citizenCardNum UserId:(NSString *)userId RechargMobile:(NSString *)rechargeMobile UserMobile:(NSString *)userMobile DealSum:(NSString *)dealSum OrderAmount:(NSString *)orderAmount TransationCode:(NSString *)transacionCode HardwareNum:(NSString *)hardwareNum block:(void (^)(NSString *))success fail:(void (^)(NSString *))fail
//{
//    [MxGlobal showWaiting];
//    NSDictionary *dicMsg = [NSDictionary dictionaryWithObjectsAndKeys:citizenCardNum,@"cardno",rechargeMobile,@"rechargMobile",userMobile,@"userMobile",dealSum,@"dealsum",orderAmount,@"orderAmount",transacionCode,@"transactionCode",hardwareNum,@"hardwareNum",nil];
//    
//    NSDictionary *dicPara = [ProtocolParserPack packwithDicMsg:dicMsg];
//    
//    NSString *strUrl = [HttpRequest getInterfaceURL:@"onlineAccount/cardConsumeCommit.action"];
//    
//    [AFNetWorkingWrapper PostAndAcceptJson:dicPara URL:strUrl Success:^(AFHTTPRequestOperation *operation, id jsonObject) {
//        [MxGlobal dismissWaiting];
//        
//        NSDictionary *dicHeader = [jsonObject objectForKey:@"head"];
//        NSString *errorMsg = [dicHeader objectForKey:@"errorMsg"];
//        
//        if ([ProtocolParserPack isSuccessful:dicHeader]) {
//            NSString *orderAmount = [[jsonObject objectForKey:@"message"] objectForKey:@"orderAmount"];
//            success(orderAmount);
//        }else fail(errorMsg);
//
//    } Failure:^(AFHTTPRequestOperation *operation, NSError *error) {
//        [MxGlobal dismissWaiting];
//        fail(@"服务器连接异常");
//    }];
//
//}
//
////中移动短信验证码发送（签约，解约，支付）
//+(void)chinaMobileBankCardBind_Resign_Pay_MsgConfirmType:(NSString *)smsType Amount:(NSString *)amount UserId:(NSString *)userId MobileNo:(NSString *)mobileNo ContractId:(NSString *)contractId ContractDic:(NSDictionary *)contractDic block:(void(^)(NSString *tradeNo))success fail:(void(^)(NSString *errorMsg))fail;
//{
//    [MxGlobal showWaiting];
//    NSDictionary *dicMsg = Nil;
//    if([smsType  isEqual: @"2"]){
//        //支付
//        dicMsg = [NSDictionary dictionaryWithObjectsAndKeys:smsType,@"smsType", contractId,@"contractId",amount,@"amount",mobileNo,@"mobileNo", nil];
//    }else if ([smsType isEqualToString:@"3"]){
//        //解约
//        dicMsg = [NSDictionary dictionaryWithObjectsAndKeys:smsType,@"smsType", contractId,@"contractId",mobileNo,@"mobileNo",nil];
//    }else if([smsType isEqualToString:@"1"]){
//        //签约
//        dicMsg = contractDic;
//    }
//    
//    NSDictionary *dicPara = [ProtocolParserPack packwithDicMsg:dicMsg];
//    NSString *strUrl = [HttpRequest getInterfaceURL:@"paymentGuide/sendSMSCodeGuide.action"];
////    NSString *strUrl = @"http://172.18.10.188:8080/ZCCardServer/paymentGuide/sendSMSCodeGuide.action";
//    [AFNetWorkingWrapper PostAndAcceptJson:dicPara URL:strUrl Success:^(AFHTTPRequestOperation *operation, id jsonObject) {
//        if (jsonObject) {
//            [MxGlobal dismissWaiting];
//            NSDictionary *dicHeader = [jsonObject objectForKey:@"head"];
//            NSString *errorMsg = [dicHeader objectForKey:@"errorMsg"];
//            if ([ProtocolParserPack isSuccessful:dicHeader]) {
//                NSDictionary *dicMsg = [jsonObject objectForKey:@"message"];
//                NSString *tradeNo = [dicMsg objectForKey:@"tradeNo"];
//                success(tradeNo);
//            }else fail(errorMsg);
//        }
//    } Failure:^(AFHTTPRequestOperation *operation, NSError *error) {
//        [MxGlobal dismissWaiting];
//        fail(@"服务器连接异常");
//    }];
//    
//    
//    
//}
//
////获得用户已经签约的银行卡列表
//
//+ (void)getUserContractBankCardsByUserID:(NSString *)userId block:(void(^)(NSArray *contractBankCardList))success fail:(void(^)(NSString *errorMsg))fail
//{
//    [MxGlobal showWaiting];
//    NSDictionary *dicMsg = [NSDictionary dictionaryWithObjectsAndKeys:nil];
//    NSDictionary *dicPara = [ProtocolParserPack packwithDicMsg:dicMsg];
//    
//    NSString *strUrl = [HttpRequest getInterfaceURL:@"paymentGuide/getUserContracts.action"];
//    
////    NSString *strUrl = @"http://172.18.10.188:8080/ZCCardServer/paymentGuide/getUserContracts.action";
//    [AFNetWorkingWrapper PostAndAcceptJson:dicPara URL:strUrl Success:^(AFHTTPRequestOperation *operation, id jsonObject) {
//        [MxGlobal dismissWaiting];
//        NSDictionary *dicHeader = [jsonObject objectForKey:@"head"];
//        NSString *errorMsg = [dicHeader objectForKey:@"errorMsg"];
//        if([ProtocolParserPack isSuccessful:dicHeader]){
//            NSDictionary *dicMessage = [jsonObject objectForKey:@"message"];
//            NSArray *signContractcmPayList = [dicMessage objectForKey:@"contractList"];
//          
//            success(signContractcmPayList);
//        
//        }else fail(errorMsg);
//        
//    } Failure:^(AFHTTPRequestOperation *operation, NSError *error) {
//        [MxGlobal dismissWaiting];
//        fail(@"服务器连接异常");
//    }];
//}
//
////获取可签约银行列表
//
//+ (void)getBankList_block:(void(^)(NSArray *BankList))success fail:(void(^)(NSString *errorMsg))fail
//{
//    [MxGlobal showWaiting];
//    NSString *strUrl = [HttpRequest getInterfaceURL:@"bankInfo/getBankList.action"];
//
//    [AFNetWorkingWrapper PostAndAcceptJson:nil URL:strUrl Success:^(AFHTTPRequestOperation *operation, id jsonObject) {
//        [MxGlobal dismissWaiting];
//        NSDictionary *dicHeader = [jsonObject objectForKey:@"head"];
//        NSString *errorMsg = [dicHeader objectForKey:@"errorMsg"];
//        
//        if([ProtocolParserPack isSuccessful:dicHeader]){
//            NSDictionary *dicMessage = [jsonObject objectForKey:@"message"];
//            NSArray *bankInfoList = [dicMessage objectForKey:@"bankInfoList"];
//            
//            success(bankInfoList);
//            
//        }else fail(errorMsg);
//
//        
//    } Failure:^(AFHTTPRequestOperation *operation, NSError *error) {
//        [MxGlobal dismissWaiting];
//        
//        fail(@"服务器连接异常");
//
//    }];
//
//}
//
////获取验证码后开始签约银行卡
//
//+ (void)signContractGuideByCtCardNo:(NSString *)citizenCardNum IDCardNum:(NSString *)idCardNum UserId:(NSString *)userId MobileNum:(NSString *)mobileNum BankAbbr:(NSString *)bankAbbr CardType:(NSString *)cardType CardCVV2:(NSString *)cardCVV2 CardExpDate:(NSString *)cardExpDate CardName:(NSString *)cardName IDType:(NSString *)idType TradeNo:(NSString *)tradeNo SmsCode:(NSString *)smsCode BankName:(NSString *)bankName block:(void(^)())success fail:(void(^)(NSString *errorMsg))fail
//{
//    
//    [MxGlobal showWaiting];
//    
//    NSDictionary *dicMsg = [NSDictionary dictionaryWithObjectsAndKeys:citizenCardNum,@"cardNo",idCardNum,@"idNo",mobileNum,@"mobileNo",bankAbbr,@"bankAbbr",cardType,@"cardType",cardCVV2,@"cardCVV2",cardExpDate,@"cardExpDate",cardName,@"cardName",idType,@"idType",tradeNo,@"tradeNo",smsCode,@"smsCode",bankName,@"bankName", nil];
//    
//    NSDictionary *dicPara = [ProtocolParserPack packwithDicMsg:dicMsg];
//    
//    NSString *strUrl = [HttpRequest getInterfaceURL:@"paymentGuide/signContractGuide.action"];
////    NSString *strUrl = @"http://172.18.10.188:8080/ZCCardServer/paymentGuide/signContractGuide.action";
//    
//    [AFNetWorkingWrapper PostAndAcceptJson:dicPara URL:strUrl Success:^(AFHTTPRequestOperation *operation, id jsonObject) {
//        [MxGlobal dismissWaiting];
//        
//        NSDictionary *dicHeader = [jsonObject objectForKey:@"head"];
//        NSString *errorMsg = [dicHeader objectForKey:@"errorMsg"];
//        if([ProtocolParserPack isSuccessful:dicHeader]){
//
//            success();
//            
//        }else fail(errorMsg);
//        
//        
//    } Failure:^(AFHTTPRequestOperation *operation, NSError *error) {
//        [MxGlobal dismissWaiting];
//        fail(@"服务器连接异常");
//    }];
//
//}
//
////解约银行卡
//
//
//+ (void)cancelContractGuideByUserID:(NSString *)userId MobileNo:(NSString *)mobileNo ContractID:(NSString *)contractId TradeNo:(NSString *)tradeNo SmsCode:(NSString *)smsCode block:(void(^)())success fail:(void(^)(NSString *errorMsg))fail
//{
//    [MxGlobal showWaiting];
//    NSDictionary *dicMsg = [NSDictionary dictionaryWithObjectsAndKeys:mobileNo,@"mobileNo",contractId,@"contractId",tradeNo,@"tradeNo",smsCode,@"smsCode", nil];
//    NSDictionary *dicPara = [ProtocolParserPack packwithDicMsg:dicMsg];
//    
//    NSString *strUrl = [HttpRequest getInterfaceURL:@"paymentGuide/cancelContractGuide.action"];
////    NSString *strUrl = @"http://172.18.10.188:8080/ZCCardServer/paymentGuide/cancelContractGuide.action";
//    
//    [AFNetWorkingWrapper PostAndAcceptJson:dicPara URL:strUrl Success:^(AFHTTPRequestOperation *operation, id jsonObject) {
//        //
//        [MxGlobal dismissWaiting];
//        NSDictionary *dicHeader = [jsonObject objectForKey:@"head"];
//        NSString *errorMsg = [dicHeader objectForKey:@"errorMsg"];
//        if([ProtocolParserPack isSuccessful:dicHeader]){
//            
//            success();
//            
//        }else fail(errorMsg);
//
//        
//    } Failure:^(AFHTTPRequestOperation *operation, NSError *error) {
//        //
//        [MxGlobal dismissWaiting];
//        fail(@"服务器连接异常");
//    }];
//
//}
//
//// 话费充值获取充值金额及优惠金额
//
//+ (void)findAllMobileRechargeByMobileNum:(NSString *)mobileNum block:(void(^)(NSArray *mobileRechargeObjectArray))success fail:(void(^)(NSString *errorMsg))fail
//{
//    [MxGlobal showWaiting];
//    
//    NSDictionary *dicMsg = [NSDictionary dictionaryWithObjectsAndKeys:mobileNum,@"mobile", nil];
//    
//    NSDictionary *dicPara = [ProtocolParserPack packwithDicMsg:dicMsg];
//    
//    NSString *strUrl = [HttpRequest getInterfaceURL:@"mobilerecharge/findAllMobileRecharge.action"];
//    
//    [AFNetWorkingWrapper PostAndAcceptJson:dicPara URL:strUrl Success:^(AFHTTPRequestOperation *operation, id jsonObject) {
//        
//        [MxGlobal dismissWaiting];
//        
//        NSDictionary *dicHeader = [jsonObject objectForKey:@"head"];
//        NSString *errorMsg = [dicHeader objectForKey:@"errorMsg"];
//        if([ProtocolParserPack isSuccessful:dicHeader]){
//            NSDictionary *dicMsg = [jsonObject objectForKey:@"message"];
//            
//            NSArray *mobileRechargeObjectArray = [dicMsg objectForKey:@"mobileRechargeList"];
//            
//            success(mobileRechargeObjectArray);
//            
//            
//        }else fail(errorMsg);
//
//        
//    } Failure:^(AFHTTPRequestOperation *operation, NSError *error) {
//        
//        [MxGlobal dismissWaiting];
//        
//        fail(@"服务器连接异常");
//        
//    }];
//    
//}
//
////查询优惠劵使用情况+过期情况
//+ (void)findAllUserCouponsByUserID:(NSString *)userId  block:(void(^)(NSArray *unUsedList, NSArray *useList, NSArray *expireList))success fail:(void(^)(NSString *errorMsg))fail
//{
//    [MxGlobal showWaiting];
//    
//    NSDictionary *dicMsg = [NSDictionary dictionaryWithObjectsAndKeys:nil];
//    
//    NSDictionary *dicPara = [ProtocolParserPack packwithDicMsg:dicMsg];
//    
//    NSString *strUrl = [HttpRequest getInterfaceURL:@"usercoupon/findAllUserCoupons.action"];
//    
//    [AFNetWorkingWrapper PostAndAcceptJson:dicPara URL:strUrl Success:^(AFHTTPRequestOperation *operation, id jsonObject) {
//        
//        [MxGlobal dismissWaiting];
//        
//        NSDictionary *dicHeader = [jsonObject objectForKey:@"head"];
//        NSString *errorMsg = [dicHeader objectForKey:@"errorMsg"];
//        if([ProtocolParserPack isSuccessful:dicHeader]){
//            NSDictionary *dicMsg = [jsonObject objectForKey:@"message"];
//            
//            NSArray *unUsedList = [dicMsg objectForKey:@"unUsedList"];
//            NSArray *useList = [dicMsg objectForKey:@"useList"];
//            NSArray *expireList = [dicMsg objectForKey:@"expireList"];
//            
//            
//            success(unUsedList,useList,expireList);
//            
//            
//        }else fail(errorMsg);
//    } Failure:^(AFHTTPRequestOperation *operation, NSError *error) {
//        [MxGlobal dismissWaiting];
//        
//        fail(@"服务器连接异常");
//    }];
//    
//}
//
////联机账户充值
//
//+ (void)paymentDisplayGuideByProductType:(NSString *)productType UserID:(NSString *)userId MobileNo:(NSString *)mobileNo ContractID:(NSString *)contractId TradeAmount:(NSString *)tradeAmount CitizenCardNum:(NSString *)citizenCardNum PaymentWayType:(NSString *)paymentWayType TradeNo:(NSString *)tradeNo SmsCode:(NSString *)smsCode block:(void(^)(NSString *amount,NSString *tradeNo, NSString *contractList))success fail:(void(^)(NSString *errorMsg))fail
//{
//    [MxGlobal showWaiting];
//    
//    NSDictionary *dicMsg = [NSDictionary dictionaryWithObjectsAndKeys:productType,@"productType",paymentWayType,@"paymentWayType",mobileNo,@"mobileNo",tradeNo,@"tradeNo",smsCode,@"smsCode",contractId,@"contractId",tradeAmount,@"tradeAmount",citizenCardNum,@"citizenCardNum", nil];
//    
//    NSDictionary *dicPara = [ProtocolParserPack packwithDicMsg:dicMsg];
//    
//    NSString *strUrl = [HttpRequest getInterfaceURL:@"paymentGuide/paymentDisplayGuide.action"];
//    
//    [AFNetWorkingWrapper PostAndAcceptJson:dicPara URL:strUrl Success:^(AFHTTPRequestOperation *operation, id jsonObject) {
//        [MxGlobal dismissWaiting];
//        
//        NSDictionary *dicHeader = [jsonObject objectForKey:@"head"];
//        NSString *errorMsg = [dicHeader objectForKey:@"errorMsg"];
//        if([ProtocolParserPack isSuccessful:dicHeader]){
//        
//            NSDictionary *dicMsg = [jsonObject objectForKey:@"message"];
//            NSString *amount = [dicMsg objectForKey:@"amount"];
//            NSString *tradeNo = [dicMsg objectForKey:@"tradeNo"];
//            NSString *contractList = [dicMsg objectForKey:@"contractList"];
//            
//            success(amount,tradeNo,contractList);
//         
//        }else fail(errorMsg);
//
//    } Failure:^(AFHTTPRequestOperation *operation, NSError *error) {
//        [MxGlobal dismissWaiting];
//        
//        fail(@"服务器连接异常");
//        
//    }];
//    
//
//}
//
//
////查询用户订单列表
//
//+ (void)findAllUserOrderByPageNum:(NSString *)pageNum block:(void(^)(NSArray *orderMsgList))success fail:(void(^)(NSString *errorMsg))fail
//{
//    [MxGlobal showWaiting];
//    NSDictionary *dicMsg = [NSDictionary dictionaryWithObjectsAndKeys:pageNum,@"currentPage", nil];
//    NSDictionary *dicPara = [ProtocolParserPack packwithDicMsg:dicMsg];
//    
//    NSString *strUrl = [HttpRequest getInterfaceURL:@"users/findAllUserOrder.action"];
//    
//    [AFNetWorkingWrapper PostAndAcceptJson:dicPara URL:strUrl Success:^(AFHTTPRequestOperation *operation, id jsonObject) {
//        [MxGlobal dismissWaiting];
//        
//        NSDictionary *dicHeader = [jsonObject objectForKey:@"head"];
//        NSString *errorMsg = [dicHeader objectForKey:@"errorMsg"];
//        
//        if ([ProtocolParserPack isSuccessful:dicHeader]) {
//            NSDictionary *dicMsg = [jsonObject objectForKey:@"message"];
//            NSArray *orderMsgList = [dicMsg objectForKey:@"orderMsgList"];
//
//            success(orderMsgList);
//            
//        }else fail(errorMsg);
//        
//    } Failure:^(AFHTTPRequestOperation *operation, NSError *error) {
//        [MxGlobal dismissWaiting];
//        fail(@"服务器连接异常");
//    }];
//    
//}
//
////退出登录
//
//+ (void)loginOut_Block:(void(^)())success fail:(void(^)(NSString *errorMsg))fail
//{
//    [MxGlobal showMessagewithStatus:@"退出中..."];
//    NSDictionary *dicPara = [ProtocolParserPack packwithDicMsg:nil];
//    
//    NSString *strUrl = [HttpRequest getInterfaceURL:@"users/loginOut.action"];
//    
//    
//    [AFNetWorkingWrapper PostAndAcceptJson:dicPara URL:strUrl Success:^(AFHTTPRequestOperation *operation, id jsonObject) {
//        [MxGlobal dismissWaiting];
//        
//        NSDictionary *dicHeader = [jsonObject objectForKey:@"head"];
//        NSString *errorMsg = [dicHeader objectForKey:@"errorMsg"];
//        
//        if ([ProtocolParserPack isSuccessful:dicHeader]) {
//           
//            success();
//            
//        }else fail(errorMsg);
//
//        
//    } Failure:^(AFHTTPRequestOperation *operation, NSError *error) {
//        [MxGlobal dismissWaiting];
//        fail(@"服务器连接异常");
//    }];
//    
//    
//}
//
////市民卡解绑:验证支付密码
//
//+ (void)checkPasswordByPassword:(NSString *)password Sign:(NSString *)sign block:(void(^)())success fail:(void(^)(NSString *errorMsg))fail
//{
//    [MxGlobal showWaiting];
//    
//    NSDictionary *dicMsg = [NSDictionary dictionaryWithObjectsAndKeys:password,@"password",sign,@"hardwareNum", nil];
//    
//    NSDictionary *dicPara = [ProtocolParserPack packwithDicMsg:dicMsg];
//    
//    NSString *strUrl = [HttpRequest getInterfaceURL:@"citizenCards/checkPassword.action"];
//    
//    [AFNetWorkingWrapper PostAndAcceptJson:dicPara URL:strUrl Success:^(AFHTTPRequestOperation *operation, id jsonObject) {
//        
//        [MxGlobal dismissWaiting];
//        
//        NSDictionary *dicHeader = [jsonObject objectForKey:@"head"];
//        NSString *errorMsg = [dicHeader objectForKey:@"errorMsg"];
//        
//        if ([ProtocolParserPack isSuccessful:dicHeader]) {
//            
//            success();
//            
//        }else fail(errorMsg);
//
//        
//    } Failure:^(AFHTTPRequestOperation *operation, NSError *error) {
//        
//         [MxGlobal dismissWaiting];
//        fail(@"服务器连接异常");
//        
//    }];
//
//    
//}
//
////市民卡解绑 验证身份证号码后6位
//
//+ (void)checkIdCardNumberByIDCardNum:(NSString *)idCardNum block:(void(^)(NSString *citizenCardStatus))success fail:(void(^)(NSString *errorMsg))fail
//{
//    [MxGlobal showWaiting];
//     NSDictionary *dicMsg = [NSDictionary dictionaryWithObjectsAndKeys:idCardNum,@"idCardNumber", nil];
//     NSDictionary *dicPara = [ProtocolParserPack packwithDicMsg:dicMsg];
//    
//     NSString *strUrl = [HttpRequest getInterfaceURL:@"citizenCards/checkIdCardNumber.action"];
//
//    [AFNetWorkingWrapper PostAndAcceptJson:dicPara URL:strUrl Success:^(AFHTTPRequestOperation *operation, id jsonObject) {
//        [MxGlobal dismissWaiting];
//        
//        NSDictionary *dicHeader = [jsonObject objectForKey:@"head"];
//        NSString *errorMsg = [dicHeader objectForKey:@"errorMsg"];
//        
//        if ([ProtocolParserPack isSuccessful:dicHeader]) {
//            NSDictionary *dicMsg = [jsonObject objectForKey:@"message"];
//            NSString *citizenCardStatus = [dicMsg objectForKey:@"citizenCardStatus"];
//            
//            success(citizenCardStatus);
//            
//        }else fail(errorMsg);
//    } Failure:^(AFHTTPRequestOperation *operation, NSError *error) {
//        [MxGlobal dismissWaiting];
//        fail(@"服务器连接异常");
//    }];
//    
//    
//    
//}
//
////市民卡获取验证码后解绑
//
//+ (void)unbundlingCitizenCardByIdCardNum:(NSString *)idCardNum PayPsw:(NSString *)payPsw MobileNum:(NSString *)mobileNum Sign:(NSString *)sign CheckCode:(NSString *)checkCode block:(void(^)())success fail:(void(^)(NSString *errorMsg))fail
//{
//    [MxGlobal showWaiting];
//    
//    NSDictionary *dicMsg = nil;
//    
//    if (sign && payPsw) {
//        dicMsg = [NSDictionary dictionaryWithObjectsAndKeys:idCardNum,@"idCardNumber",payPsw,@"password",mobileNum,@"mobile",sign,@"hardwareNum",checkCode,@"checkCode", nil];
//        
//    }else {
//    
//         dicMsg = [NSDictionary dictionaryWithObjectsAndKeys:idCardNum,@"idCardNumber",mobileNum,@"mobile",checkCode,@"checkCode", nil];
//    }
//    
//   
//    NSDictionary *dicPara = [ProtocolParserPack packwithDicMsg:dicMsg];
//    
//    NSString *strUrl = [HttpRequest getInterfaceURL:@"citizenCards/unbundlingCitizenCard.action"];
//    
//    [AFNetWorkingWrapper PostAndAcceptJson:dicPara URL:strUrl Success:^(AFHTTPRequestOperation *operation, id jsonObject) {
//        [MxGlobal dismissWaiting];
//        
//        NSDictionary *dicHeader = [jsonObject objectForKey:@"head"];
//        NSString *errorMsg = [dicHeader objectForKey:@"errorMsg"];
//        
//        if ([ProtocolParserPack isSuccessful:dicHeader]) {
//            success();
//            
//        }else fail(errorMsg);
//    } Failure:^(AFHTTPRequestOperation *operation, NSError *error) {
//        [MxGlobal dismissWaiting];
//        fail(@"服务器连接异常");
//    }];
//
//}
//
////更新按钮、拓展按钮是否显示接口
//
//+ (void)getParamsBlock:(void(^)(BOOL updateButtonEnable,BOOL expandButtonEnable))success fail:(void(^)(NSString *errorMsg))fail
//{
//    
//    NSDictionary *dicPara = [ProtocolParserPack packwithDicMsg:nil];
//    NSString *strUrl = [HttpRequest getInterfaceURL:@"system/getParams.action"];
//    [AFNetWorkingWrapper PostAndAcceptJson:dicPara URL:strUrl Success:^(AFHTTPRequestOperation *operation, id jsonObject) {
//       
//        
//        NSDictionary *dicHeader = [jsonObject objectForKey:@"head"];
//        NSString *errorMsg = [dicHeader objectForKey:@"errorMsg"];
//        
//        if ([ProtocolParserPack isSuccessful:dicHeader]) {
//            
//            NSDictionary *dicMsg = [jsonObject objectForKey:@"message"];
//            BOOL updateButtonEnable = [[dicMsg objectForKey:@"updateButtonEnable"] boolValue];
//            BOOL expandButtonEnable = [[dicMsg objectForKey:@"expandButtonEnable"] boolValue];
//            success(updateButtonEnable,expandButtonEnable);
//            
//            
//        }else fail(errorMsg);
//        
//    } Failure:^(AFHTTPRequestOperation *operation, NSError *error) {
//        fail(@"服务器连接异常");
//    }];
//    
//    
//}
//
//+ (void)getQiNiuPicStorageToken:(NSString *)code DeviceID:(NSString *)deviceID Block:(void(^)(NSString *tokenNum))success fail:(void(^)(NSString *errorMsg))fail
//{
//    [MxGlobal showWaiting];
//    NSDictionary *dicMsg = [NSDictionary dictionaryWithObjectsAndKeys:code,@"code",deviceID,@"deviceId", nil];
//    NSDictionary *dicPara = [ProtocolParserPack packwithDicMsg:dicMsg];
//    
//    NSString *strUrl = [HttpRequest getInterfaceURL:@"ZCCardServer/token/getToken.action"];
//    strUrl = @"http://172.18.10.8:8080/ZCCardServer/token/getToken.action";
//    
//    [AFNetWorkingWrapper PostAndAcceptJson:dicPara URL:strUrl Success:^(AFHTTPRequestOperation *operation, id jsonObject) {
//        
//        [MxGlobal dismissWaiting];
//        
//        NSDictionary *dicHeader = [jsonObject objectForKey:@"head"];
//        NSString *errorMsg = [dicHeader objectForKey:@"errorMsg"];
//        
//        if ([ProtocolParserPack isSuccessful:dicHeader]) {
//            
//            NSDictionary *dicMsg = [jsonObject objectForKey:@"message"];
//            NSString *token = [dicMsg objectForKey:@"token"];
//            
//            success(token);
//            
//            
//        }else fail(errorMsg);
//
//        
//        
//    } Failure:^(AFHTTPRequestOperation *operation, NSError *error) {
//         [MxGlobal dismissWaiting];
//         fail(@"服务器连接异常");
//        
//    }];
//    
//    
//
//}

@end
